home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / DSUTIL12 / NOTATION.DOC < prev    next >
Text File  |  1991-10-25  |  8KB  |  201 lines

  1.  
  2.                 **************************************
  3.                 * Copyright (C) 1991, Dima Stefankov *
  4.                 * But available for free reproduce   *
  5.                 **************************************
  6.  
  7.  
  8.   ********************  PREFIX DESCRIPTION NOTATION  ****************
  9.  
  10.     NOTE:  Produced by Dima Stefankov, 09.17.91 - 10.25.91
  11.            I hearfelt thank V.V.Begtin for an advanced discussion 
  12.            about the structured style of computer programming and
  13.            also for his great support over the years.
  14.         
  15.  
  16.         Basic idea:  Names of variables, functions, labels, etc.
  17.                      may be prefaced by short description of the nature
  18.                      of these objects.
  19.  
  20.                 
  21.  1.    Main rule to build the prefaced name:
  22.  
  23.               [Moderator][DataTypeDesc][Moderator]Name
  24.  
  25.    General note: the lowercase letters may be mixed with
  26.                  the uppercase letters to produce the more readable text.
  27.  
  28.  
  29.         mnemonics                  data type
  30.      ------------     -------------------------------
  31.         bt                      bit
  32.         b                       boolean
  33.         ch                      char
  34.         db                      byte (unsigned char)
  35.         dw                      word (unsigned int)
  36.         dd                      double word (unsigned long)
  37.         i                       integer
  38.         r                       real
  39.         s                       string
  40.         sz                      string terminated by NULL (0)
  41.  
  42.   Examples:     iLineCount      ---   variable of integer type
  43.                 
  44.                 szArgument      ---   string terminated with \0
  45.                     (C language)
  46.                 chUserCmd       ---   variable of char type
  47.  
  48.                 bFileOK         ---   boolean variable
  49.  
  50.  
  51.  
  52.  
  53.   2.    The following moderators are used
  54.         to define a corresponding data type:
  55.  
  56.         mnemonics             data type moderator
  57.      -------------      -------------------------
  58.          u                    unsigned 
  59.          sh                   short
  60.          l                    long
  61.      n              near
  62.          g                global declaration
  63.          a                absolute value (constant),
  64.                   immediate value
  65.         
  66.   Examples:     liBytesInFile   ----   variable of long integer type
  67.   
  68.                 uchTerminator   ----   variable of unsigned char type
  69.                                             (or byte type)
  70.  
  71.                 gdbTestResult   ----    global variable of byte type
  72.                 
  73.                 achESCAPE       ----    constant of char type
  74.                 
  75.         aConstant    ----    just a constant
  76.         
  77.  
  78.  
  79.  
  80.    3.    Basic data types for some popular computer languages 
  81.          with the suggested mnemonics:
  82.         
  83.           ASM                         C                        PASCAL
  84.   ---------------------    ------------------------     -----------------------
  85.    char           ch        char               ch         char           ch
  86.    byte           db        unsigned char      uch,db     byte           db
  87.                             unsigned short     ushi,db    shortint       shi
  88.                                integer         
  89.    word           dw        unsigned integer   ui,dw      word           dw
  90.    double word    dd        long int           li         longint        li
  91.    real           r         float              r          real           r
  92.                             integer            i          integer        i
  93.                             unsigned long int  uli        boolean        b
  94.                             short int          shi        string      s
  95.                 
  96.  
  97.   Examples:   C language    liCharCount    ---  char count var of longint
  98.  
  99.                             dwFileHandle   ---  handle of file (word type)
  100.  
  101.           Pascal language   rTempValue     ---  real type value
  102.                             
  103.                             sUserInput     ---  get user string input
  104.                             
  105.           ASM  language     chUserInKey    ---  user input key of char type
  106.                                                   (i.e. to byte type)
  107.                             ddUserFileSize --- file size of double word type  
  108.                               
  109.  
  110.  
  111.  
  112.   4.    The following moderators are used
  113.         to construct a advanced data type with 'pointer':
  114.  
  115.       mnemonics                    pointer type
  116.   ----------------       ----------------------------------
  117.         p                       pointer
  118.         np                      near(short) pointer 
  119.         lp                      long(far) pointer
  120.  
  121.   Examples:     pdbCharCount    ----    pointer to var of byte type
  122.                 
  123.                 lpszWarnMessage ----    long pointer to null-terminated string
  124.                 
  125.  
  126.  
  127.  
  128.   5.   The following moderators are used
  129.         to construct the code functions:
  130.  
  131.       mnemonics                  meaning
  132.   ----------------       ----------------------------------
  133.        _fn                      function
  134.        _                        procedure
  135.        @                        label
  136.        mac@                     macro
  137.  
  138.  
  139.   Examples:     _TestInput      ---     procedure
  140.                 
  141.                 _fndbGetChar    ---     function, return value of byte type
  142.                 
  143.                 _fndwSetMask    ---     function, return  word value
  144.                 
  145.                 _fnGetChar      ---     function, but value type at return
  146.                                            not specified
  147.                 mac@DosOp       ---     macro definition or macro call
  148.                 
  149.                 @Exit           ---     code label
  150.                 
  151.                 dw@MemSize      ---     data label of word type
  152.                 
  153.  
  154.  
  155.  
  156.   6.    The following moderators are used
  157.         to construct a some special data structures
  158.         (they may be used without the data type definition, and
  159.          they may be useful for PC programmers):
  160.  
  161.       mnemonics                 meaning
  162.   ----------------       ----------------------------------
  163.         h                       handle  (usually word)
  164.         m                       message (usually word)
  165.         w                       window  (usually word)
  166.         f                       file    (type depends on language)
  167.         x,y,z                   coordinates X,Y,Z (word or integer)
  168.         err                     error code         (usually byte)
  169.         cmd                     interface command  (usually byte)
  170.         reg                     register       (usually byte)
  171.         io                      input/output       (usually byte)
  172.         op                    offset of address (pointer)
  173.         sp                  segment of address (pointer)
  174.  
  175.   Examples:     
  176.         hInFile              ---  file handle of word type     
  177.         
  178.         fINPUT                ---  file structure INPUT
  179.         
  180.         mUserAsk              ---  message  UserAsk 
  181.                                     (messages are often used in 
  182.                        object-oriented OS)
  183.         hdbUSER               ---  8-bit user window handle 
  184.         
  185.         errDisketteNotDrive   ---  return error code for disk handler
  186.         
  187.         errdbDisketteNotDrive ---  same as above only with the data type
  188.                                       description
  189.         cmddbTestDrive,       ---  equivalent forms to send a command
  190.      
  191.         cmdTestDrive               to disk controller
  192.         
  193.         regCMOS_A_status,     ---  status register A in CMOS memory
  194.         
  195.         regdbCMOS_A_STAT           of byte size
  196.  
  197.     opUserInput          ---  offset of variable
  198.  
  199.  
  200. ********** compiled by Dima Stefankov, 07/23/91, original version ********
  201.